/* GUI CONVERTED from rcrp07.p (converter v1.76) Fri May  3 13:21:39 2002 */
/* rcrp07.p - Release Management Customer Schedules                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.6.1.4 $                                                     */
/*V8:ConvertMode=FullGUIReport                                          */
/* REVISION: 7.3    LAST MODIFIED: 10/06/92           BY: WUG *G462*    */
/* REVISION: 7.3    LAST MODIFIED: 01/12/95           BY: srk *G0C1*    */
/* REVISION: 7.3    LAST MODIFIED: 07/23/96           BY: *G29C* Ajit Deodhar */
/* REVISION: 7.3    LAST MODIFIED: 11/06/96           BY: *G2HP* Suresh Nayak */
/* REVISION: 8.6    LAST MODIFIED: 10/07/97           BY: bvm *K0MJ*          */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane            */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan           */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown           */
/* REVISION: 9.1    LAST MODIFIED: 09/04/00   BY: *N0RB* Mudit Mehta          */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.6.1.4 $    BY: Katie Hilbert         DATE: 04/15/02  ECO: *P03J*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/* SHIPPING SUMMARY REPORT */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}
{rcrpvar.i "new shared"}

define new shared variable start         as date label "Start Date".
define new shared variable sdate         as date extent 14.
define new shared variable interval      as integer extent 14.
define new shared variable dwm           as character format "x(1)"
                                         label "Day/Week/Month".
define new shared variable idays         as integer format ">9"
                                         label "Per Column".
define new shared variable num_intervals as integer initial 13.

define variable sortoption    as integer
                              label "Sort Option"
                              format "9" initial 1 no-undo.
define variable sortextoption as character
                              extent 2 format "x(66)" no-undo.
define variable  monthend     as integer no-undo.
define variable  i            as integer no-undo.

assign
   sortextoption[1] = "1 - " + getTermLabel("BY_SHIP-FROM",12)      + "," +
                               getTermLabel("CUSTOMER",4)           + "," +
                               getTermLabel("SHIP-TO",7)            + "," +
                               getTermLabel("ORDER",5)              + "," +
                               getTermLabel("DOCK",4)               + "," +
                               getTermLabel("ITEM",4)               + "," +
                               getTermLabel("PURCHASE_ORDER",2)     + "," +
                               getTermLabel("CUSTOMER_REFERENCE",8) + "," +
                               getTermLabel("MODEL_YEAR",8)
   sortextoption[2] = "2 - " + getTermLabel("BY_SHIP-FROM",12)      + "," +
                               getTermLabel("ITEM",4)               + "," +
                               getTermLabel("CUSTOMER",4)           + "," +
                               getTermLabel("SHIP-TO",7)            + "," +
                               getTermLabel("ORDER",5)              + "," +
                               getTermLabel("DOCK",4)               + "," +
                               getTermLabel("PURCHASE_ORDER",2)     + "," +
                               getTermLabel("CUSTOMER_REFERENCE",8) + "," +
                               getTermLabel("MODEL_YEAR",8).

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
shipfrom_from  colon 16 label "Ship-From"
   shipfrom_to    colon 46 label {t001.i}
   cust_from      colon 16
   cust_to        colon 46 label {t001.i}
   shipto_from    colon 16
   shipto_to      colon 46 label {t001.i}
   dock_from      colon 16
   dock_to        colon 46 label {t001.i}
   part_from      colon 16
   part_to        colon 46 label {t001.i}
   po_from        colon 16 format "x(22)"
   po_to          colon 46 label {t001.i} format "x(22)"
   custref_from   colon 16 format "x(22)"
   custref_to     colon 46 label {t001.i}
   modelyr_from   colon 16
   modelyr_to     colon 46 label {t001.i}
   order_from     colon 16
   order_to       colon 46 label {t001.i}
   start          colon 16
   dwm            colon 16
   idays          colon 16
   sortoption     colon 16
   skip
   sortextoption[1]   at 10 no-label
   sortextoption[2]   at 10 no-label
   skip(1)
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

assign
   start = today
   dwm = "D"
   idays = 1.

{wbrp01.i}

/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   display
      sortextoption
   with frame a.

   if shipfrom_to = hi_char then shipfrom_to = "".
   if cust_to     = hi_char then cust_to     = "".
   if shipto_to   = hi_char then shipto_to   = "".
   if dock_to     = hi_char then dock_to     = "".
   if part_to     = hi_char then part_to     = "".
   if po_to       = hi_char then po_to       = "".
   if custref_to  = hi_char then custref_to  = "".
   if modelyr_to  = hi_char then modelyr_to  = "".
   if order_to    = hi_char then order_to    = "".

   if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  shipfrom_from shipfrom_to
        cust_from cust_to shipto_from shipto_to dock_from dock_to
        part_from part_to po_from po_to custref_from custref_to modelyr_from modelyr_to
        order_from order_to start dwm idays sortoption " &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i shipfrom_from}
      {mfquoter.i shipfrom_to}
      {mfquoter.i cust_from}
      {mfquoter.i cust_to}
      {mfquoter.i shipto_from}
      {mfquoter.i shipto_to}
      {mfquoter.i dock_from}
      {mfquoter.i dock_to}
      {mfquoter.i part_from}
      {mfquoter.i part_to}
      {mfquoter.i po_from}
      {mfquoter.i po_to}
      {mfquoter.i custref_from}
      {mfquoter.i custref_to}
      {mfquoter.i modelyr_from}
      {mfquoter.i modelyr_to}
      {mfquoter.i order_from}
      {mfquoter.i order_to}
      {mfquoter.i start}
      {mfquoter.i dwm}
      {mfquoter.i idays}
      {mfquoter.i sortoption}

      if shipfrom_to = "" then shipfrom_to = hi_char.
      if cust_to     = "" then cust_to     = hi_char.
      if shipto_to   = "" then shipto_to   = hi_char.
      if dock_to     = "" then dock_to     = hi_char.
      if part_to     = "" then part_to     = hi_char.
      if po_to       = "" then po_to       = hi_char.
      if custref_to  = "" then custref_to  = hi_char.
      if modelyr_to  = "" then modelyr_to  = hi_char.
      if order_to    = "" then order_to    = hi_char.

      sdate[1] = today.
      {mfcsdate.i}

      sdate[1] = low_date.

   end.
   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead.i}

   if sortoption = 1 then do:
      {gprun.i ""rcrp07a.p""}
   end.

   else
      if sortoption = 2 then do:
      {gprun.i ""rcrp07b.p""}
   end.

   /* REPORT TRAILER */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" shipfrom_from shipfrom_to cust_from cust_to shipto_from shipto_to dock_from dock_to part_from part_to po_from po_to custref_from custref_to modelyr_from modelyr_to order_from order_to start dwm idays sortoption "} /*Drive the Report*/
